package com.android.jixin.channel.ui.activity;

import android.os.Bundle;
import android.support.annotation.NonNull;
import android.view.View;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.afollestad.materialdialogs.DialogAction;
import com.afollestad.materialdialogs.MaterialDialog;
import com.android.jixin.channel.R;
import com.android.jixin.channel.base.BaseActivity;
import com.android.jixin.channel.presenter.impl.RegisterUserCompletePresenterImpl;
import com.android.jixin.channel.view.IRegisterUserCompleteView;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import butterknife.OnTextChanged;

public class RegisterUserCompleteActivity extends BaseActivity<RegisterUserCompletePresenterImpl> implements IRegisterUserCompleteView {

    @BindView(R.id.title)
    TextView title;
    @BindView(R.id.name)
    EditText name;
    @BindView(R.id.gender)
    TextView gender;
    @BindView(R.id.phone)
    EditText phone;
    @BindView(R.id.idcard)
    EditText idcard;
    @BindView(R.id.qq)
    EditText qq;
    @BindView(R.id.education)
    TextView education;
    @BindView(R.id.grade)
    TextView grade;
    @BindView(R.id.province)
    TextView province;
    @BindView(R.id.city)
    TextView city;
    @BindView(R.id.area)
    TextView area;
    @BindView(R.id.school)
    TextView school;
    @BindView(R.id.submit)
    TextView submit;

    @Override
    protected void initView() {
        title.setText(getString(R.string.register_title));
    }

    @Override
    protected int getContentViewLayoutID() {
        return R.layout.activity_register_user_complete;
    }

    @Override
    protected void initInjector() {
        getActivityComponent().inject(this);
    }

    @OnTextChanged({R.id.name, R.id.gender, R.id.phone})
    void onhoneChanged(CharSequence text){

    }

    @OnClick({R.id.gender, R.id.education, R.id.grade, R.id.province, R.id.city, R.id.area, R.id.school, R.id.submit})
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.gender:
                break;
            case R.id.education:
                break;
            case R.id.grade:
                break;
            case R.id.province:
                break;
            case R.id.city:
                break;
            case R.id.area:
                break;
            case R.id.school:
                break;
            case R.id.submit:
                doSubmit();
                break;
        }
    }

    @Override
    public void setSubmitEnable(boolean enable) {

    }

    private void doSubmit(){
        new MaterialDialog.Builder(this)
                .title(R.string.prompt)
                .content("是否需要再次检查个人信息")
                .positiveText(R.string.submit)
                .negativeText(R.string.check)
                .onPositive(new MaterialDialog.SingleButtonCallback() {
                    @Override
                    public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) {
                        readyGo(RegisterSubmitActivity.class);
                    }
                })
                .show();
    }
}
